package com.chen.palmar.common.datasource;


import com.chen.palmar.entity.AgencyDetailEntity;
import com.chen.palmar.entity.AgencyListEntity;
import com.chen.palmar.entity.AgencyTagEntity;
import com.chen.palmar.entity.AliPayEntity;
import com.chen.palmar.entity.ApplyInfoEntity;
import com.chen.palmar.entity.ApplyManagerEntity;
import com.chen.palmar.entity.ApplyTagEntity;
import com.chen.palmar.entity.AuthEntity;
import com.chen.palmar.entity.CityListEntity;
import com.chen.palmar.entity.CollectEntity;
import com.chen.palmar.entity.CollectionAgencyEntity;
import com.chen.palmar.entity.CollectionInfoEntity;
import com.chen.palmar.entity.CollectionProducerEntity;
import com.chen.palmar.entity.CollectionStoreEntity;
import com.chen.palmar.entity.DetailEntity;
import com.chen.palmar.entity.EditShopEntity;
import com.chen.palmar.entity.GoodEntity;
import com.chen.palmar.entity.HomeBanEntity;
import com.chen.palmar.entity.HomeInfoEntity;
import com.chen.palmar.entity.HomeListEntity;
import com.chen.palmar.entity.LoginEntity;
import com.chen.palmar.entity.MessageCallEntity;
import com.chen.palmar.entity.MessageCommentEntity;
import com.chen.palmar.entity.MessageNoticeEntity;
import com.chen.palmar.entity.NewListEntity;
import com.chen.palmar.entity.PayWXEntity;
import com.chen.palmar.entity.ProducerBaseEntity;
import com.chen.palmar.entity.ProducerHouseEntity;
import com.chen.palmar.entity.ProducerInfoEntity;
import com.chen.palmar.entity.ProducerStoreEntity;
import com.chen.palmar.entity.SearchEntity;
import com.chen.palmar.entity.SelectProducerEntity;
import com.chen.palmar.entity.SetShopEntity;
import com.chen.palmar.entity.ShareEntity;
import com.chen.palmar.entity.ShopInfoEntity;
import com.chen.palmar.entity.ShopListEntity;
import com.chen.palmar.entity.StoreDetailEntity;
import com.chen.palmar.entity.TagListEntity;
import com.chen.palmar.entity.TypeListEntity;
import com.chen.palmar.entity.UserInfoEntity;
import com.chen.palmar.entity.VipEntity;
import com.primb.androidlibs.net.entity.HttpResultEntity;
import com.primb.androidlibs.net.entity.WXEntity;
import com.primb.androidlibs.net.entity.WXPayEntity;

import java.util.Map;

import okhttp3.MultipartBody;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;
import rx.Observable;

/**
 * Created by Chen on 2017/4/25.
 * 功能描述：
 */

public interface ApiService {
    /**
     * 登录接口
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/login.json")
    Observable<LoginEntity> getLoginInfo(@Field("any") String any);

    /**
     * 第三方登录接口
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/third.json")
    Observable<LoginEntity> otherLoginInfo(@Field("any") String any);

    /**
     * 退出登录接口
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/loginout.json")
    Observable<HttpResultEntity> outLoginInfo(@Field("any") String any);

    /**
     * 获取验证码
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/sendCode.json")
    Observable<AuthEntity> getAuthCode(@Field("any") String any);

    /**
     * 验证码注册
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/validateCode.json")
    Observable<LoginEntity> register(@Field("any") String any);

    /**
     * 忘记密码
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/resetPassword.json")
    Observable<HttpResultEntity> targetPwd(@Field("any") String any);

    /**
     * 第一次登陆设置
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/firstSetting.json")
    Observable<LoginEntity> firstSetting(@Field("any") String any);

    /**
     * 首页列表信息
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("article/list.json")
    Observable<HomeListEntity> homeListInfo(@Field("any") String any);

    /**
     * 首页轮播图信息
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("adv/list.json")
    Observable<HomeBanEntity> homeBanInfo(@Field("any") String any);

    /**
     * 首页资讯头条信息
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("article/squareList.json")
    Observable<HomeInfoEntity> homeInfoInfo(@Field("any") String any);

    /**
     * 商品详情
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("article/detail.json")
    Observable<DetailEntity> detailInfo(@Field("any") String any);

    /**
     * 发表评论
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("article/addComment.json")
    Observable<HttpResultEntity> commentInfo(@Field("any") String any);

    /**
     * 点赞
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("article/addPraise.json")
    Observable<GoodEntity> goodInfo(@Field("any") String any);

    /**
     * 收藏
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/addFavorite.json")
    Observable<CollectEntity> collectInfo(@Field("any") String any);

    /**
     * 取消收藏
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/updFavorite.json")
    Observable<CollectEntity> collectCancelInfo(@Field("any") String any);

    /**
     * 经销商首页列表
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/list.json")
    Observable<AgencyListEntity> listAgencyInfo(@Field("any") String any);

    /**
     * 经销商城市列表
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("address/list.json")
    Observable<CityListEntity> listCityInfo(@Field("any") String any);

    /**
     * 经销商热门城市列表
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("address/hot/list.json")
    Observable<CityListEntity> listHotCityInfo(@Field("any") String any);

    /**
     * 厂家首页shop列表
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/store/recommend.json")
    Observable<ShopListEntity> listProducerShop(@Field("any") String any);

    /**
     * 厂家首页type列表
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/category/list.json")
    Observable<TypeListEntity> listProducerType(@Field("any") String any);

    /**
     * 厂家首页new列表
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("product/recommend.json")
    Observable<NewListEntity> listProducerNew(@Field("any") String any);

    /**
     * 厂家筛选列表
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/store/detail/list.json")
    Observable<SelectProducerEntity> listProducerSelect(@Field("any") String any);

    /**
     * 厂家详情
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/factNameAndLogo.json")
    Observable<ProducerInfoEntity> listProducerInfo(@Field("any") String any);


    /**
     * 厂家下的商品
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/product.json")
    Observable<ProducerStoreEntity> producerStoreInfo(@Field("any") String any);

    /**
     * 厂家下的企业信息
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/work.json")
    Observable<ProducerHouseEntity> producerHouseInfo(@Field("any") String any);

    /**
     * 厂家下的基础信息
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/detail.json")
    Observable<ProducerBaseEntity> producerBaseInfo(@Field("any") String any);

    /**
     * 商品详情
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("product/detail.json")
    Observable<StoreDetailEntity> storeDetailInfo(@Field("any") String any);

    /**
     * 商品询单
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("product/enquiry.json")
    Observable<HttpResultEntity> contractSeller(@Field("any") String any);


    /**
     * 经销商详情
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/disrt/detail.json")
    Observable<AgencyDetailEntity> agencyDetailInfo(@Field("any") String any);

    /**
     * 标签列表
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/label/list.json")
    Observable<TagListEntity> tagListInfo(@Field("any") String any);

    /**
     * 发布信息（供应，采购）
     *
     * @param any
     * @return
     */
    @Multipart
    @POST("article/addArticle.json")
    Observable<ApplyInfoEntity> applyInfo(@Query("any") String any, @Part MultipartBody.Part[] parts);


    /**
     * 发布信息（供应，采购）
     *
     * @param any
     * @return
     */
    @POST("article/addArticle.json")
    Observable<ApplyInfoEntity> applyInfo(@Query("any") String any);


    /**
     * 发布信息（供应，采购）
     *
     * @param any
     * @return
     */
    @Multipart
    @POST("article/updArticle.json")
    Observable<ApplyInfoEntity> updateApplyInfo(@Query("any") String any, @Part MultipartBody.Part[] parts);


    /**
     * 发布信息（供应，采购）
     *
     * @param any
     * @return
     */
    @POST("article/updArticle.json")
    Observable<ApplyInfoEntity> updateApplyInfo(@Query("any") String any);


    /**
     * 发布经销商
     *
     * @param any
     * @return
     */
    @Multipart
    @POST("factory/disrt/add.json")
    Observable<HttpResultEntity> applyAgency(@Query("any") String any,  @Part() MultipartBody.Part file);


    /**
     * 发布经销商
     *
     * @param any
     * @return
     */
    @POST("factory/disrt/add.json")
    Observable<HttpResultEntity> applyAgency(@Query("any") String any);

    /**
     * 经销商标签列表
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/channel/list.json")
    Observable<AgencyTagEntity> agencyTagList(@Field("any") String any);

    /**
     * 个人信息
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/getPersonalData.json")
    Observable<UserInfoEntity> getUserInfo(@Field("any") String any);

    /**
     * 修改昵称
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/changeName.json")
    Observable<HttpResultEntity> editUserName(@Field("any") String any);

    /**
     * 修改手机号
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/changeMobile.json")
    Observable<HttpResultEntity> editUserPhone(@Field("any") String any);

    /**
     * 修改头像
     *
     * @param any
     * @return
     */
    @Multipart
    @POST("user/changeAvatar.json")
    Observable<HttpResultEntity> editUserHead(@Query("any") String any, @Part() MultipartBody.Part file);

    /**
     * 厂家认证
     *
     * @param any
     * @return
     */
    @Multipart
    @POST("factory/certif.json")
    Observable<HttpResultEntity> applyIdentityInfo(@Query("any") String any, @Part() MultipartBody.Part file);

    /**
     * 收藏管理-信息
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/favoriteArticle.json")
    Observable<CollectionInfoEntity> collectionInfoList(@Field("any") String any);


    /**
     * 收藏管理-经销商
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/favoriteDis.json")
    Observable<CollectionAgencyEntity> collectionAgencyList(@Field("any") String any);

    /**
     * 收藏管理-商品
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/favoriteProduct.json")
    Observable<CollectionStoreEntity> collectionStoreList(@Field("any") String any);

    /**
     * 收藏管理-厂家
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/favoriteStore.json")
    Observable<CollectionProducerEntity> collectionProducerList(@Field("any") String any);

    /**
     * 消息-询单信息
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/enquiryMesg.json")
    Observable<MessageCallEntity> messageCallInfo(@Field("any") String any);

    /**
     * 消息-评论
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/commentMesg.json")
    Observable<MessageCommentEntity> messageCommentInfo(@Field("any") String any);

    /**
     * 消息-系统公告
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/noticeMesg.json")
    Observable<MessageNoticeEntity> messageNoticeInfo(@Field("any") String any);

    /**
     * 创建店铺
     *
     * @param any
     * @return
     */
    @Multipart
    @POST("factory/addStore.json")
    Observable<ShopInfoEntity> applyShopInfo(@Query("any") String any, @Part() MultipartBody.Part file);

    /**
     * 发布商品
     *
     * @param any
     * @return
     */
    @Multipart
    @POST("product/addProduct.json")
    Observable<HttpResultEntity> applyStoreInfo(@Query("any") String any, @Part MultipartBody.Part[] parts);


    /**
     * 发布商品
     *
     * @param any
     * @return
     */
    @POST("product/addProduct.json")
    Observable<HttpResultEntity> applyStoreInfo(@Query("any") String any);

    /**
     * 会员中心
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/member.json")
    Observable<VipEntity> vipCenter(@Field("any") String any);

    /**
     * 开通会员
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/toBeMember.json")
    Observable<HttpResultEntity> openVip(@Field("any") String any);

    /**
     * 服务协议
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("terms/list.json")
    Observable<HttpResultEntity> serviceInfo(@Field("any") String any);

    /**
     * 发布管理
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("article/user/list.json")
    Observable<ApplyManagerEntity> applyManagerList(@Field("any") String any);

    /**
     * 删除发布
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("article/del.json")
    Observable<HttpResultEntity> deleteApply(@Field("any") String any);

    /**
     * 用户分类下的店铺
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/user/store.json")
    Observable<SetShopEntity> userShopList(@Field("any") String any);

    /**
     * 编辑原有店铺
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/store/detail.json")
    Observable<EditShopEntity> editShopInfo(@Field("any") String any);

    /**
     * 更新原有店铺信息
     *
     * @param any
     * @return
     */
    @Multipart
    @POST("factory/store/update.json")
    Observable<HttpResultEntity> updateShopInfo(@Query("any") String any, @Part() MultipartBody.Part file);

    /**
     * 更新原有店铺信息
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("factory/store/update.json")
    Observable<HttpResultEntity> updateShopInfo(@Field("any") String any);

    /**
     * 店铺的商品列表
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("product/list.json")
    Observable<NewListEntity> storeList(@Field("any") String any);

    /**
     * 删除商品
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("product/del.json")
    Observable<HttpResultEntity> deleteStore(@Field("any") String any);


    /**
     * 更新商品
     *
     * @param any
     * @return
     */
    @Multipart
    @POST("product/updProduct.json")
    Observable<HttpResultEntity> updateStoreInfo(@Query("any") String any, @Part MultipartBody.Part[] parts);


    /**
     * 更新商品
     *
     * @param any
     * @return
     */
    @POST("product/updProduct.json")
    Observable<HttpResultEntity> updateStoreInfo(@Query("any") String any);

    /**
     * 搜索
     *
     * @param any
     * @return
     */
    @POST("user/search.json")
    Observable<SearchEntity> searchInfo(@Query("any") String any);

    /**
     * 获取微信用户id
     *
     * @param map
     * @return
     */
    @GET
    Observable<WXEntity> wxUserId(@Url String url, @QueryMap Map<String, String> map);

    /**
     * 微信支付
     *
     * @param any
     * @return
     */
    @POST("so/create.json")
    Observable<PayWXEntity> wxPay(@Query("any") String any);

    /**
     * 支付宝支付
     *
     * @param any
     * @return
     */
    @POST("so/create.json")
    Observable<AliPayEntity> aliPay(@Query("any") String any);

    /**
     * 微信支付测试接口
     *
     * @param url
     * @return
     */
    @GET
    Observable<WXPayEntity> wxPayCeshi(@Url String url);


    /**
     * 分享生成链接
     *
     * @param any
     * @return
     */
    @POST("app/share.json")
    Observable<ShareEntity> shareContent(@Query("any") String any);

    /**
     * 发布信息标签列表
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("article/label/list.json")
    Observable<ApplyTagEntity> applyTagListInfo(@Field("any") String any);

    /**
     * 修改密码
     *
     * @param any
     * @return
     */
    @FormUrlEncoded
    @POST("user/updPassword.json")
    Observable<HttpResultEntity> changePwd(@Field("any") String any);
}
